﻿using System;
using System.Diagnostics.Contracts;
using System.Windows.Data;

namespace AnthStat.WPF.Applications.Converters
{
    [ValueConversion(typeof(string), typeof(System.Windows.Visibility))]
    public sealed class ImperialSystemToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string system = value.ToString();

            if (system.Equals("Imperial", StringComparison.OrdinalIgnoreCase))
            {
                return System.Windows.Visibility.Visible;
            }
            else
            {
                return System.Windows.Visibility.Collapsed;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}